# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=docker-compose
pkgver=1.26.2
pkgrel=0
pkgdesc="Define and run multi-container applications with Docker"
url="https://docs.docker.com/compose/"
arch="noarch"
license="Apache-2.0"
options="!check" # requires a running docker engine

# dependencies are sorted like in requirements.txt
depends="python3
	py3-setuptools
	py3-cached-property>=1.5.1
	py3-certifi>=2020.4.5.1
	py3-chardet>=3.0.4
	py3-distro>=1.5.0
	docker-py>=4.2.2
	dockerpy-creds>=0.4.0
	py3-dockerpty>=0.4.1
	py3-docopt>=0.6.2
	py3-idna>=2.8
	py3-ipaddress>=1.0.23
	py3-jsonschema>=3.2.0
	py3-paramiko>=2.7.1
	py3-pysocks>=1.7.1
	py3-dotenv>=0.13.0
	py3-yaml>=5.3
	py3-requests>=2.22.0
	py3-texttable>=1.6.2
	py3-websocket-client>=0.57.0
	"
checkdepends="bash docker py3-pytest py3-nose py3-mock py3-flake8 py3-coverage"
subpackages="$pkgname-bash-completion $pkgname-zsh-completion $pkgname-fish-completion"
source="docker-compose-$pkgver.tar.gz::https://github.com/docker/compose/archive/$pkgver.tar.gz"
builddir="$srcdir/compose-$pkgver"

build() {
	# allow newer version of dependencies
	sed -e 's/, < [0-9.]\+//' -i setup.py
	python3 setup.py build
}

check() {
	script/test/default
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	install -Dm0644 "$builddir"/contrib/completion/bash/docker-compose \
		"$pkgdir"/usr/share/bash-completion/completions/docker-compose
	install -Dm0644 "$builddir"/contrib/completion/zsh/_docker-compose \
		"$pkgdir"/usr/share/zsh/site-functions/_docker-compose
	install -Dm0644 "$builddir"/contrib/completion/fish/docker-compose.fish \
		"$pkgdir"/usr/share/fish/completions/docker-compose.fish
}

sha512sums="4cb8a2f5e25f17eb842e36dea96fae8862df099d706ec590e6fc0790c7a814bed3bb60ec00207e4afc15bf8ad4ca37075320fd28ee0bea5bbec1646f3aed681f  docker-compose-1.26.2.tar.gz"
